package com.hs.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hs.sfzy.entity.PsychKnow;
import com.hs.sfzy.mapper.PsychKnowMapper;
import com.hs.sfzy.service.PsychKnowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PsychKnowServiceImpl implements PsychKnowService {
    @Autowired
    PsychKnowMapper psychKnowMapper;


    @Override
    public PageInfo<PsychKnow> getAll(PsychKnow psychKnow, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<PsychKnow> all = psychKnowMapper.getAll(psychKnow);
        PageInfo<PsychKnow> pageInfo = new PageInfo<>(all);
        return pageInfo;
    }

    @Override
    public PsychKnow getById(int id) {
        return psychKnowMapper.getById(id);
    }
}
